/*!
\file AlgKruskal.h
\brief Contains declaration of AlgKruskal.
\ingroup Plugins
*/

#ifndef ALGKRUSKAL_H
#define ALGKRUSKAL_H

#include<QApplication>
#include<Graph.h>
#include<Algorithm.h>
#include<Visualizer.h>
#include<ContainerElement.h>

/*!
\class AlgKruskal
\brief Implements Kruskal's Algorithm.
\ingroup Plugins
*/

class AlgKruskal: public Algorithm{
public:
	AlgKruskal( Graph *g );
	//!< Constructor.
	~AlgKruskal();
	//!< Destructor.
	void run();
	//!< Algorithm is executed here.
	void sortEdges();
	//!< Initialisation of Algorithm
	void populateNodes();
	//!< Initialisation last phase.
	int containerContaining( const Node &n );
	//!< Returns which container holds Node n. -1 if none.
	void swap( int &a, int &b );
	//!< Swaps two integers
	void merge( int src, int dst, const Edge &e );
	//!< Merge contents of one container into another.
private:
};

#endif